package com.zoodt.web.controller;


import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class IndexController {
    @RequestMapping({"","/","index.html"})
    public String index(){
        return "index";
    }

    @RequestMapping("/list.html")
    public String list(Model model, String usr, String pwd){
        try{
            if(usr == null || pwd == null){
                throw new Exception("发生错误，参数不能为空！");
            }
            System.out.println("name:"+usr);
            System.out.println("pwd:"+pwd);
            return "list";
        } catch ( Exception e){
            model.addAttribute("msg",e.getMessage());
            return "error";
        }
    }
}
